package day06;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;

public class ArraySort {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        //初始化数组
        int[] arr = new int[5];
        int[] brr = new int[5];
        //创建随机数对象
        Random r = new Random();
        //接受随机数数据
        for (int i = 0; i < 5; i++) {
            int num = r.nextInt(100);
            arr[i] = num;
        }
        Arrays.sort(arr);
        System.out.println(Arrays.toString(arr));
        for (int i = arr.length - 1; i >= 0; i--) {
            list.add(arr[i]);
        }
        System.out.println(list);
    }
}
